package vn.edu.saigontech.ncms.model.info;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.OptimisticLockType;

import vn.edu.saigontech.ncms.model.BaseEntity;
import vn.edu.saigontech.ncms.model.program.Level;

@Entity
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true, optimisticLock = OptimisticLockType.ALL)
@Table(name = "ncms_waiting")
@SuppressWarnings("serial")
public class Waiting extends BaseEntity {
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "level_id", nullable = false)
	private Level level;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "student_id", nullable = false)
	private Student student;
	
	@Column(name = "registered_date")
	@Temporal(TemporalType.DATE)
	private Date registeredDate;
	
	@Column(name = "comment", length = 4000)
	private String comment;
	
	@Transient
	private Date fromRegisteredDate;
	
	@Transient
	private Date toRegisteredDate;
	
	public Student getStudent() {
		return student;
	}
	
	public void setStudent(Student student) {
		this.student = student;
	}

	public Level getLevel() {
		return level;
	}

	public void setLevel(Level level) {
		this.level = level;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public Date getRegisteredDate() {
		return registeredDate;
	}

	public void setRegisteredDate(Date registeredDate) {
		this.registeredDate = registeredDate;
	}

	public Date getFromRegisteredDate() {
		return fromRegisteredDate;
	}

	public void setFromRegisteredDate(Date fromRegisteredDate) {
		this.fromRegisteredDate = fromRegisteredDate;
	}

	public Date getToRegisteredDate() {
		return toRegisteredDate;
	}

	public void setToRegisteredDate(Date toRegisteredDate) {
		this.toRegisteredDate = toRegisteredDate;
	}
}